import java.util.Arrays;
import java.util.Random;

//定义功能，将数组中的0元素，使用1-10之间的随机数替换掉。
//int[] arr = {1,43,43,5,4,6,6,7,7,88,9,9,9,0,0,9};
public class zy5 {
    public static void main(String[] args) {
        int[] arr = {1, 43, 43, 5, 4, 6, 6, 7, 7, 88, 9, 9, 9, 0, 0, 9};
        int[] a = tihuan(arr);
        System.out.println(Arrays.toString(arr));
    }

    private static int[] tihuan(int[] arr) {
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 0) {
                arr[i] = r.nextInt(10) + 1;
            }
        }
        return arr;
    }
}
